package P1400;

import java.util.Scanner;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-09-29 19:15
 */
public class P1425_小鱼的游泳时间 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int begin = 0,end = 0;
        begin = scanner.nextInt()*60+scanner.nextInt();
        end = scanner.nextInt()*60+scanner.nextInt();
        scanner.close();
        int diff = end-begin;
        System.out.printf("%s %s",diff/60,diff%60);
    }
}
